package com.ipc.app.constants;

import java.lang.reflect.Field;
import java.util.LinkedList;
import java.util.List;

/**
 * 信息状态
 * 
 * @author haijie.zhang
 * 
 */
public class InformationStatusConstants {

	/**
	 * 长期有效
	 */
	public static final String LONG_EFFECTIVE = "00";

	/**
	 * 迄今有效
	 */
	public static final String EFFECTIVE = "01";

	/**
	 * 过期失效
	 */
	public static final String EXPIRED = "02";

	/**
	 * 
	 */
	private static List<String> values = null;

	public static boolean isContain(String arg0) {
		if (null == values) {
			values = new LinkedList<String>();
			Field[] fields = InformationStatusConstants.class
					.getDeclaredFields();
			for (Field field : fields) {
				try {
					String value = field.get("").toString();
					values.add(value);
				} catch (IllegalArgumentException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IllegalAccessException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

			}
		}

		if (values.contains(arg0)) {
			return true;
		}
		return false;
	}

}
